﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using nERP.Model;
using nERP.Model.Bas;

namespace nERP.Model.Bas
{
    /// <summary>
    /// 商品类别
    /// </summary>
	[Table("GoodsClass")]
    [SoftKey(nameof(GoodsClass.Name))]
    [Display(Name = "_Model.GoodsClass")]
    public class GoodsClass : BasePoco,IPersistPoco,ITenant
    {
        [Display(Name = "_Model._GoodsClass._Name")]
        [StringLength(64, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("商品类别名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [CanNotEdit]
        public string Name { get; set; }
        [Display(Name = "_Model._GoodsClass._Remark")]
        [StringLength(256, ErrorMessage = "Validate.{0}stringmax{1}")]
        [Comment("备注")]
        public string Remark { get; set; }
        [Display(Name = "_Model._Goods._GoodsType")]
        [InverseProperty("GoodsType")]
        [NotMapped]
        [SoftFK(nameof(nERP.Model.Bas.Goods.GoodsTypeId))]
        public List<Goods> Goods_GoodsType { get; set; }
        [Display(Name = "_Model._GoodsClass._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
